-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ztimer/periodic: reinit remove from right clock and handle aquired ztimer #19826
Conversation
ba1d5f9
to
c4c555f
Compare
upgraded this to bug, since restart is documented but leaves a wrong ztimer_aquire/release count without this PR (since it isn't tracking correctly unless the same number for starts and stops happen) RIOT/sys/include/ztimer/periodic.h Line 122 in b482a71
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense, but uncrustify is not happy (and rightfully so)
c4c555f
to
abecdd0
Compare
sys/ztimer/periodic.c
Outdated
ztimer_remove(timer->clock, &timer->timer); | ||
ztimer_release(timer->clock); | ||
timer->timer.arg = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also do this (other than the ztimer_remove()
) inside _ztimer_periodic_callback()
for the !ZTIMER_PERIODIC_KEEP_GOING
case?
Why is ztimer_acquire()
/ztimer_release()
needed here when we do a ztimer_set()
anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is ztimer_acquire()/ztimer_release() needed here when we do a ztimer_set() anyway?
atm it needs the aquire (at least for start), but maybe we can rewrite it
abecdd0
to
957021e
Compare
How about this but now it should be tested did that -> failed added |
957021e
to
a2054e8
Compare
b9ab8aa
to
1cb9bcf
Compare
- not ztimer_now calls outsid irq -> remove aquire
1cb9bcf
to
4f2237d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine here generally, didn't do any testing.
ACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors merge
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Contribution description
#19806 added some retinit handling for ztimer periodic removing the timer from the new clock
This tries to detect if this is a reinit and remove the timer from the old clock
this also removes the ztimer_acquire/_release handling by removing now calls in favour of set return value and now values that are allready in ztimer,
that also has the potential to reduce the jitter of the periodic calls and bus-usage (for cpus that take their time to get "now")
Testing procedure
read
run tests/sys/ztimer_periodic
Issues/PRs references
Fixes #19806